"""
ResumeMyWay
An app which allows you to create an online personal professional journal and 
easily generate different versions of your resume for different purposes.

Copyright (c) 2011 Jay Baxter, Saher Ahwal, Wesam Manassra, Arun Saigal
"""

#from flaskext.sqlalchemy import SQLAlchemy
from .. import db
from .. import utils

selected_items = db.Table('selected_items',
    db.Column('profile_id', db.Integer, db.ForeignKey('profile.id')),
    db.Column('item_id', db.Integer, db.ForeignKey('item.id'))
)

class Profile(db.Model):
    # this declaration results in an autoincrementing id
    id = db.Column(db.Integer, primary_key=True)
    created = db.Column(db.Integer)
    
    selected_items = db.relationship('selected_items', secondary=selected_items,
        backref=db.backref('profiles', lazy='dynamic'))
    
    # declare many-one relationship to user
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    user = db.relationship('User', backref=db.backref('profiles', lazy='dynamic'))
    

    def __init__(self, dict):
        pass

    def __repr__(self):
        return '<Profile number %r of user %r>' % (self.id, self.user)